

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class home
 */
public class home extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public home() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		this.getHomeData(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		this.getHomeData(request, response);
	}
	
	private void getHomeData(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		
		RequestDispatcher rd = this.getServletContext().getRequestDispatcher("/home.jsp");
		rd.forward(request, response);
		/*tracker oTracker = new tracker();
		boolean isAuthenticated = oTracker.isAuthenticated(request, response);
		
		if(isAuthenticated == false) {
			response.sendRedirect(request.getContextPath() + "/signIn.jsp");
			//RequestDispatcher rd = this.getServletContext().getRequestDispatcher("/signIn.jsp");
			//rd.forward(request, response);
		}
		else {
			RequestDispatcher rd = this.getServletContext().getRequestDispatcher("/home.jsp");
			rd.forward(request, response);
		}*/
		
	}

}
